import request from '@/utils/request'

// 查询商品基础信息列表
export function listGoods(query) {
  return request({
    url: '/goods/goods/list',
    method: 'get',
    params: query
  })
}

// 查询商品基础信息详细
export function getGoods(id) {
  return request({
    url: '/goods/goods/' + id,
    method: 'get'
  })
}

// 新增商品基础信息
export function addGoods(data) {
  return request({
    url: '/goods/goods',
    method: 'post',
    data: data
  })
}

// 修改商品基础信息
export function updateGoods(data) {
  return request({
    url: '/goods/goods',
    method: 'put',
    data: data
  })
}

// 删除商品基础信息
export function delGoods(id) {
  return request({
    url: '/goods/goods/' + id,
    method: 'delete'
  })
}

// 导出商品基础信息
export function exportGoods(query) {
  return request({
    url: '/goods/goods/export',
    method: 'get',
    params: query
  })
}

// 设置商品系列
export function setSeriesId(data) {
  return request({
    url: '/goods/goods/setSeriesId/'+data.ids,
    method: 'post'
  })
}

// 同步商品
export function tbGoodsPrice(data) {
  return request({
    url: '/supplierGoods/supplierGoods/tbGoodsPrice/'+data.ids,
    method: 'post'
  })
}

// 获取商品图片信息
export function getGoodsImgInfo(data) {
  return request({
    url: '/goods/goods/getGoodsImgInfo',
    method: 'post',
    data: data
  })
}

// 获取商品信息
export function getScGoodsInfo(data) {
  return request({
    url: '/goods/goods/getGoodsInfo?goodsId='+data.goodsId,
    method: 'post',
    data: data
  })
}

export function tbAllGoods(data) {
  return request({
    url: '/supplierGoods/supplierGoods/tbAllGoods',
    method: 'post',
    data: data,
    timeout:null
  })
}

export function tbCgtpGoods(data) {
  return request({
    url: '/goods/goods/cgptTb',
    method: 'post',
    data: data,
    timeout:null
  })
}



